package com.tensquare.articlecrawler.dao;

import com.tensquare.articlecrawler.pojo.Column;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
public interface ColumnDao extends JpaRepository<Column,String>,JpaSpecificationExecutor<Column>{

    //专栏审核
    @Modifying
    @Query("update Column set state='1' where id=?1")
    public void examine(String id);

    //根据用户id查询出专栏列表
    public List<Column> findAllByUseridAndState(String uid, String state);
}
